package ejercicio2;

import ejercicio1.Biblioteca;
import ejercicio1.IBibliotecable;

public class Libro implements IBibliotecable {
   private Biblioteca bib;
   private int posAbs;
   private int codLib;
   private String nomLib;
   private String autLib;
   private String editLib;

   public Libro(int codLib, String nomLib, String autLib, String editLib) {
      super();
      setCodigo(codLib);
      setNombre(nomLib);
      setAutor(autLib);
      setEditorial(editLib);
      clearBiblioteca();
      clearPosAbs();
   }

   @Override
   public void clearBiblioteca() {
      // TODO Auto-generated method stub
      bib = null;
   }

   @Override
   public void clearPosAbs() {
      // TODO Auto-generated method stub
      posAbs = -1;
   }

   @Override
   public Biblioteca getBiblioteca() {
      // TODO Auto-generated method stub
      return bib;
   }

   @Override
   public int getPosAbs() {
      // TODO Auto-generated method stub
      return posAbs;
   }

   @Override
   public String getTipo() {
      // TODO Auto-generated method stub
      return "Libro";
   }

   @Override
   public void setBiblioteca(Biblioteca biblio) {
      // TODO Auto-generated method stub
      bib = biblio;
   }

   @Override
   public void setPosAbs(int posAbs) {
      // TODO Auto-generated method stub
      this.posAbs = posAbs;
   }

   public int getCodigo() {
      return codLib;
   }

   public String getNombre() {
      return nomLib;
   }

   public String getAutor() {
      return autLib;
   }

   public String getEditorial() {
      return editLib;
   }

   public void setCodigo(int codLib) {
      this.codLib = codLib;
   }

   public void setNombre(String nomLib) {
      this.nomLib = nomLib;
   }

   public void setAutor(String autLib) {
      this.autLib = autLib;
   }

   public void setEditorial(String editLib) {
      this.editLib = editLib;
   }
}
